< previous page page_114 next page >

Page 114
0114-01.jpg
Figure 6.5
The Menu Editor enables you to create
hierarchical menu systems quickly and easily.
13. Click OK to close the Menu Editor.
tip.gif
I typically use a hierarchical structure to assign the Name property of my menu items. Each menu item's name begins with the prefix mnu-, followed by words that describe the portion of the menu in which the item is located. For example, mnuFileSendToFax is used to represent the menu item with the caption Fax Recipient; I can tell from the name that this item is in the Send To submenu of the File menu.

note.gif Occasionally, a menu item's caption ends with an ellipsis ( . . . ), as in the Open and Print items in the example. This ellipsis signifies to the users that more information, such as a filename and location, are needed to complete the requested command. After users select such a command, your program requests the appropriate information via a dialog box. square.gif

Now that you're back in the Visual Basic design environment, you can click Form1's File menu to see what it looks like. At this point, you may decide that you would like to group the commands that work with managing filesNew, Open, and Savetogether, as well as the Print and Send To commands. To do so, you need to move the Print menu down so that the file functions are together. You can then insert separator bars to group the related functions.
Grouping Menu Items
In addition to using menu levels to organize the items in your menu, you might want to further separate items in a particular level. Placing separator bars in the menu breaks up a long list of items and further groups the items, without your having to create a separate level. To place a separator bar in your menu, enter a hyphen (-) as the menu item's Caption property. It creates a separator bar that is the full width of the drop-down menu in which it appears. Remember, you must give each separator bar a unique value for its Name property, just as with any other menu item. I typically use incrementing numbers as part of the names of my separator menu itemsmnuHyphen1, mnuHyphen2, and so on.

 
< previous page page_114 next page >